package com.fishbone.cloud.auth.security.model;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.List;

/**
 * @ClassName FishBoneUser
 * @Author huyaxi
 * @DATE 2020/3/31 9:34
 */
@Getter
public class FishBoneUser extends User {
    /*** 登录账号用户ID */
    private Long userId;
    /*** 登录账号用户信息 */
    private String account;
    /*** 用户姓名 */
    private String name;
    /*** 用户头像ID */
    private Long avatar;
    /*** 客户ID */
    private Long tenantId;
    /*** 手机号 */
    private String phone;
    /*** 角色编号 */
    private List<Long> roleIds;
    /*** 用户状态 */
    private Integer status;
    /*** 是否删除 */
    private boolean isDeleted;

    public FishBoneUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, Long userId, String account, String name, Long avatar, Long tenantId,
                        String phone, List<Long> roleIds, Integer status, boolean isDeleted) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.userId = userId;
        this.account = account;
        this.name = name;
        this.avatar = avatar;
        this.tenantId = tenantId;
        this.phone = phone;
        this.roleIds = roleIds;
        this.status = status;
        this.isDeleted = isDeleted;
    }
}
